import Vue from 'vue';
import confirm from './uploadFiles.vue';

let ConfirmConstructor = Vue.extend(confirm);
let rm_uploadFiles = function (text) {
    return new Promise((res, rej) => { //promise封装，confirm执行res，cancel执行rej
        let confirmDom = new ConfirmConstructor({
            el: document.createElement('div')
        })
        document.body.appendChild(confirmDom.$el); //new一个对象插入body里面
        confirmDom.text = text;
        confirmDom.isSuccess = function () {
            res({
                flag: confirmDom.flag,
                msg: confirmDom.msg
            })
        }
    })
}
export default rm_uploadFiles;